﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace CheckDB
{
    public static class StoreDatabaseInfor
    {
        #region "Cac ham su dung trong chuong trinh"
        public static void WriteToFile(string myConnString)
        {
            StreamWriter SW;
            try
            {
                SW = File.CreateText(Application.StartupPath + "\\Logininfo.txt");
                SW.WriteLine(myConnString);
                SW.Close();
                Readfile();
            }
            catch { }
        }
        public static bool Readfile()
        {
            StreamReader SR;
            try
            {
                SR = File.OpenText(Application.StartupPath + "\\Logininfo.txt");
                ClsConnection.connectString1 = SR.ReadLine();
                SR.Close();
                return true;
            }
            catch { }
            return false;
        }
        #endregion
    }
}
